package cn.webrx;

import java.io.FileInputStream;
import java.util.Arrays;

public class Ex7 {
    public static void main(String[] args) {
        try(FileInputStream fis = new FileInputStream("mysrc.txt")){
            //int b = 0;
            //while((b = fis.read())!=-1){
            //    System.out.println(b);
            //}
            //System.out.println(b);

            byte[] buf = new byte[3];
            int len = fis.read(buf);
            System.out.println(len);
           System.out.println(Arrays.toString(buf));
            System.out.println(new String(buf));
            fis.skip(fis.available()-3);
            len = fis.read(buf);
            System.out.println(len);
            System.out.println(Arrays.toString(buf));
            System.out.println(new String(buf));



        }catch(Exception e){

        }
    }
}
